<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box{
      background-color: aqua;
      width: 200px;
      left: 0;
      position: absolute;
      height: 200px;
    }
  </style>
</head>

<body>
  
  <div class="box"></div>
  <script>
    function move() {
      let sq = document.querySelector('.box')
      console.log(sq.offsetLeft)
      
      if( sq.offsetLeft< 1000){
        sq.style.left = sq.offsetLeft + 10 +'px'
        // setTimeout(() => {
          requestAnimationFrame(move)
        // }, 60);
       
      }
      
    }
  //  setInterval(() => {
    move()

  //  }, 500);
  </script>
</body>
</html>